﻿using Microsoft.EntityFrameworkCore;
namespace DBContext
{
    public class EmContext : DbContext
    {
        public EmContext() { }
        public EmContext(DbContextOptions options) : base(options) { }

        public DbSet<DBModel.EM.EmailServiceConfig> EmailServiceConfigs { get; set; }
        public DbSet<DBModel.EM.EmGxykdx> EmGxykdxs { get; set; }


#if DEBUG
        /*
        //创建数据库表的脚本是，需要当前函数，除此之外应注释掉
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            //MySQL
            //var _connString = "Server=192.168.99.7;Database=test;User ID=gxbid;Password=123456;";
            //optionsBuilder.UseMySql(_connString);

            //SQLite
            var _connString = @"Data Source=pm.db";
            optionsBuilder.UseSqlite(_connString);
        }
        //*/
#endif
    }
}
